<template>
	<view class="page" :style="themeColor">
		<view class="flex benben-position-layout flex flex-wrap align-center classification_flex_0"
			:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class='flex flex-wrap align-center justify-between flex-sub classification_fd0_0'>
				<view class='flex flex-wrap align-stretch justify-center flex-sub'>
					<text class='classification_fd0_0_c0_c0'>分类</text>
				</view>
			</view>

		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
		<view class="loading_css" v-if="!isShow">
			<u-loading size="36" color="#4177DD"></u-loading>
			<view class="loading_text">加载中</view>
		</view>
		
		<block v-else>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout">
				<view class='flex flex-wrap align-center flex-sub classification_fd1_0'>
					<view class='flex flex-direction flex-wrap align-center justify-center classification_fd1_0_c0' v-for="(v, k) in dataList" :key="k" @tap.stop="jumpFunc(v.id)">
						<image class='classification_fd1_0_c0_c0' mode="aspectFill" :src='v.thumb'></image>
						<view class='classification_fd1_0_c0_c1'>{{v.name}}</view>
					</view>
				</view>
			</view>
			<!---flex布局flex布局结束-->
			
			<view class="noData" v-if="dataList.length == 0">
				<image src="/static/empty/no.png"></image>
				<view>暂无分类~</view>
			</view>
		</block>

	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},


		data() {
			return {
				"dataList": [],
				"click_aid": "",
				"isShow": false
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			this.getData();
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			// this.DataListFunc()
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			// 获取商品类型  post65643c7e5a8ed
			getData() {
				this.$api.post(global.apiUrls.post65643c7e5a8ed, {
					
				}).then(res =>{
					console.log(res);
					this.isShow = true;
					if (res.data.code == 1) {
						this.dataList = res.data.data
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			
			//获取分类
			async DataListFunc() {
				//请求方法
				//数据验证

				let datadataList = await this.$api.get(global.apiUrls.post6436c9d302226, {

				});
				this.isShow = true;
				if (datadataList.data.code != 1) {
					this.$message.info(datadataList.data.msg);
					return
				}
				let infodataList = datadataList.data;
				this.dataList = infodataList.data
			},
			//跳转
			jumpFunc(id) {
				uni.navigateTo({
					url: '/pages/homepage/zoneList/zoneList?zone_type=' + id
				})
				// this.$urouter.navigateTo(
				// 	`/pages/homepage/searchResult/searchResult?cid=${this.click_aid}`);
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: rgba(255, 255, 255, 1);
		background-size: 100% auto !important;
	}

	.classification_flex_0 {
		border-bottom: 1px solid rgba(230, 230, 230, 1);
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.classification_fd0_0_c0_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333333;
		line-height: 50rpx;
	}

	.classification_fd0_0 {
		margin: 0rpx 32rpx 0rpx 32rpx;
	}

	.classification_fd1_0_c0_c1 {
		color: #2A2A2A;
		font-size: 26rpx;
		font-weight: 500;
		line-height: 37rpx;
		margin: 16rpx 0rpx 0rpx 0rpx;
		max-width: 182rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-align: center;
	}

	.classification_fd1_0_c0_c0 {
		width: 182rpx;
		height: 108rpx;
		border-radius: 8rpx;
	}

	.classification_fd1_0_c0 {
		margin: 33rpx 27rpx 0rpx 27rpx;
	}

	.classification_fd1_0 {
		margin: 20rpx 20rpx 0rpx 20rpx;
	}
</style>